//
//  HomePageModel.m
//  u76ho
//
//  Created by m-air-01 on 16/1/20.
//  Copyright © 2016年 LV. All rights reserved.
//

#import "HomePageModel.h"

@implementation HomePageModel
-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
-(void)setValue:(id)value forKey:(NSString *)key
{
    if (!value) {
        return;
    }
    else
    {
        if ([key isEqualToString:@"errmsg"]) {
            NSArray * arr1 = [value objectForKey:@"0"];
            NSMutableArray * mArr1 = [[NSMutableArray alloc]init];
            for (int i = 0; i<arr1.count; i++) {
                NSDictionary * dic = arr1[i];
                scrollPicModel * model = [[scrollPicModel alloc]initDic:dic];
                [mArr1 addObject:model];
            }
            _scrollPicModelArray = mArr1;
            
            //********
            NSArray * arr2 = [value objectForKey:@"4"];
            NSMutableArray * marr2 = [[NSMutableArray alloc]init];
            for (int i = 0; i<arr2.count; i++) {
                NSDictionary * dic = arr2[i];
                commendActivityModel * model = [[commendActivityModel alloc]initDic:dic];
                [marr2 addObject:model];
            }
            _commendActivityModelArray = marr2;
            //*********
            NSArray * arr3 = [value objectForKey:@"2"];
            NSMutableArray * mArr3 = [[NSMutableArray alloc]init];
            for (int i = 0; i<arr3.count; i++) {
                NSDictionary * dic = arr3[i];
                commendModel * model = [[commendModel alloc]initDic:dic];
                [mArr3 addObject:model];
            }
            _commendCompanyModelArray = mArr3;
            
            //********
            NSArray * arr5 = [value objectForKey:@"5"];
            NSMutableArray * marr5 = [[NSMutableArray alloc]init];
            for (int i = 0; i<arr5.count; i++) {
                NSDictionary * dic = arr5[i];
                LRModel * model = [[LRModel alloc]initDic:dic];
                [marr5 addObject:model];
            }
            _LrModelArray = marr5;
            //**********
//            NSDictionary * dic = [value objectForKey:@"5"];
//            commendActivityModel * model = [[LRModel alloc]initDic:dic];
//            _lrmodel = model;
        }
    }
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}
@end
//*************************************************
@implementation scrollPicModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
-(void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}

@end
//*************************************************
@implementation commendActivityModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
-(void)setValue:(id)value forKey:(NSString *)key
{
    if (!value) {
        return;
    }
    else
    {
        [super setValue:value forKey:key];
    }
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}
@end
//*************************************************
@implementation commendModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
-(void)setValue:(id)value forKey:(NSString *)key
{
    if (!value) {
        return;
    }
    else
    {
        [super setValue:value forKey:key];
    }
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}
@end

//*************************************************
@implementation LRModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if (value) {
        [super setValue:value forKey:key];
    }
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}

@end